package co.fitstart.admin.dao;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dynamic;
import com.demo2do.core.persistence.annotation.Limit;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;

import co.fitstart.entity.coupon.CouponBatch;
import co.fitstart.entity.coupon.CreditCouponBatch;

/**
 * 
 * @author Ysy
 *
 */
@Dynamic("hibernate")
public interface CreditCouponBatchDao {
    
    /**
     * 
     * @param beginIndex
     * @param maxResult
     * @return
     */
    @Limit
    @Query("FROM CreditCouponBatch ORDER BY createTime DESC, creditValue ASC")
    public List<CreditCouponBatch> list(@Variable("beginIndex") int beginIndex, @Variable("maxResult") int maxResult);
    
    /**
     * 
     * @return
     */
    @Query("FROM CreditCouponBatch ORDER BY createTime DESC, creditValue ASC")
    public List<CreditCouponBatch> list();
    
    /**
     * 
     * @param couponBatch
     * @return
     */
    @Query("FROM CreditCouponBatch WHERE couponBatch = :couponBatch")
    public CreditCouponBatch loadByCouponBatch(@Variable("couponBatch")CouponBatch couponBatch);

}
